//
//  LLCollectionViewCell.m
//  LLPhotoBrowser
//
//  Created by zhaomengWang on 17/2/6.
//  Copyright © 2017年 MaoChao Network Co. Ltd. All rights reserved.
//

#import "LLVCollectionViewCell.h"

@implementation LLVCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithWhite:1 alpha:0.5];
        CGRect rect = self.bounds;
//        rect.size.width -= 10;
//        rect.origin.x = 5;
        float top = (rect.size.height-rect.size.width)/2;
        CGRect llRect = CGRectMake((rect.size.width-rect.size.width*9.0/16.0)/2, top, rect.size.width*9.0/16.0, rect.size.width);
        _photo = [[LLPhoto alloc] initWithFrame:llRect];
        _photo.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        [self addSubview:_photo];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _photo.zoomScale = 1.0;
    _photo.contentSize = _photo.bounds.size;
}

@end
